<?php /* Smarty version 2.6.26, created on 2011-01-28 15:58:03
         compiled from admin/submodules/tmanagement.dialog.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'default', 'admin/submodules/tmanagement.dialog.html', 9, false),array('modifier', 'date_format', 'admin/submodules/tmanagement.dialog.html', 115, false),)), $this); ?>
<script type="text/javascript">
<!--<?php echo '
$(document).ready
(
    function()
    {
	$(\'div#time-management\')
	    .dialog(\'option\',\'title\',\'Тайм-менеджмент\')
	    .dialog(\'option\',\'height\','; ?>
<?php echo ((is_array($_tmp=@$_SESSION['manager']['options']['dialog']['timeReport']['height'])) ? $this->_run_mod_handler('default', true, $_tmp, '"auto"') : smarty_modifier_default($_tmp, '"auto"')); ?>
<?php echo ')
	    .dialog(\'option\',\'width\','; ?>
<?php echo ((is_array($_tmp=@$_SESSION['manager']['options']['dialog']['timeReport']['width'])) ? $this->_run_mod_handler('default', true, $_tmp, '400') : smarty_modifier_default($_tmp, '400')); ?>
<?php echo ');

	$(\'a#time-management-button\').click
	(
	    function()
	    {
		$(\'div#time-management\')
		    .dialog(\'open\');
	    }
	);

	$.getJSON
	(
	    \'timeReport.php\',
	    { do: \'init\' },
	    function(options)
	    {
		$(\'table#jqg-TimeReport\')
		    .jqGrid(options);

		$(\'table#jqg-TimeReport\')
		    .setGridHeight('; ?>
<?php echo $_SESSION['manager']['options']['dialog']['timeReport']['height']; ?>
<?php echo '-170)
		    .setGridWidth('; ?>
<?php echo ((is_array($_tmp=@$_SESSION['manager']['options']['dialog']['timeReport']['width'])) ? $this->_run_mod_handler('default', true, $_tmp, '400') : smarty_modifier_default($_tmp, '400')); ?>
<?php echo '-30);

		$(\'div#time-management\').dialog
		({
		    \'resizeStop\':	function(event,ui)
					{
					    $.getJSON
					    (
						\'options.php\',
						{
						    module:	\'dialog\',
						    moduleName:	\'timeReport\',
						    width:	ui.size.width,
						    height:	ui.size.height
						}
					    );
					    $(\'table#jqg-TimeReport\').setGridHeight(ui.size.height-170);
					    $(\'table#jqg-TimeReport\').setGridWidth(ui.size.width-30);
					}
		});

		$(\'select#manager-id\').change
		(
		    function()
		    {
			$(\'table#jqg-TimeReport\')
			    .jqGrid
			    (
				\'setGridParam\',
				{
				    url:	\'timeReport.php?manager_id=\'+$(this).val()
						+\'&startDate=\'+$(\'#tm-start\').val()
						+\'&stopDate=\'+$(\'#tm-stop\').val(),
				    page:	1
				}
			    )
			    .trigger(\'reloadGrid\');
		    }
		);

		$(\'a#tm-setPeriod\').click
		(
		    function()
		    {
			$(\'table#jqg-TimeReport\')
			    .jqGrid
			    (
				\'setGridParam\',
				{
				    url:	\'timeReport.php?manager_id=\'+$(\'select#manager-id\').val()
						+\'&startDate=\'+$(\'#tm-start\').val()
						+\'&stopDate=\'+$(\'#tm-stop\').val(),
				    page:	1
				}
			    )
			    .trigger(\'reloadGrid\');
		    }
		);
	    }
	);

    }
);
'; ?>
-->
</script>

<!-- Окно тайм-менеджмента -->
<div class="dialog" id="time-management">
    <table width="100%" class="ui-widget">
	<tr>
	    <td align="right"><strong>Менеджер</strong></td>
	    <td>
		<select id="manager-id">
		    <option value="">&mdash;</option>
		<?php $_from = $this->_tpl_vars['managers']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['manager']):
?>
		    <option value="<?php echo $this->_tpl_vars['manager']['id']; ?>
"><?php echo $this->_tpl_vars['manager']['manager_name']; ?>
</option>
		<?php endforeach; endif; unset($_from); ?>
		</select>
	    </td>
	</tr>
	<tr>
	    <td align="right"><strong>Период:</strong></td>
	    <td>
		с <input type="text" id="tm-start" class="date" value="<?php echo ((is_array($_tmp=time())) ? $this->_run_mod_handler('date_format', true, $_tmp, '%Y-%m-01') : smarty_modifier_date_format($_tmp, '%Y-%m-01')); ?>
"/>
		по <input type="text" id="tm-stop" class="date" value="<?php echo ((is_array($_tmp=time())) ? $this->_run_mod_handler('date_format', true, $_tmp, '%Y-%m-%d') : smarty_modifier_date_format($_tmp, '%Y-%m-%d')); ?>
"/>
		<a href="javascript:void(0)" id="tm-setPeriod"><img src="images/icons/tick_16.png"/></a>
	    </td>
	</tr>
    </table>
    <table id="jqg-TimeReport"></table>
    <div id="jqg-TimeReport-pager"></div>
</div>